#include <bits/stdc++.h>
// 2025/07/16
// tag: Subtraction
// Author: Forever
using namespace std;
using int64 = int64_t;

string a, b;

bool cmp(string a, string b)
{
    if (a.size() != b.size())
        return a.size() > b.size();
    for (int i = 0; i < a.size(); i++)
        if (a[i] != b[i])
            return a[i] > b[i];
    return true;
}

string sub(string a, string b)
{
    string res;
    int i = a.size() - 1, j = b.size() - 1;
    int carry = 0;
    while (i >= 0 || j >= 0)
    {
        int x = i >= 0 ? a[i] - '0' : 0;
        int y = j >= 0 ? b[j] - '0' : 0;
        int diff = x - y - carry;
        if (diff < 0)
        {
            diff += 10;
            carry = 1;
        }
        else
            carry = 0;
        res += diff + '0';
        i--, j--;
    }
    reverse(res.begin(), res.end());
    return res;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> a >> b;
    if (!cmp(a, b))
        cout << "-", swap(a, b);
    if (a == b)
        cout << 0;
    else 
        cout << sub(a, b);
    return 0;
}